<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>User</title>
    <script type="text/javascript" th:src="@{/js/jquery.js}"></script>
    <script type="text/javascript">

        function submitData(){
            $.post("[[${url}]]",
                {
                    name:$("#name").val(),
                    age:$("#age").val()
                },
                function(result){
                    alert(result);
                }
            );
        }
    </script>
</head>
<body>
姓名：<input type="text" id="name"/><br/>
年龄：<input type="text" id="age"/><br/>
<input type="button" onclick="submitData()" value="提交"/>

<h3>列表：</h3>
<ul class="list-group">
    <li th:each="item : ${list}" class="list-group-item">
        <p th:text="'id:'+${item.id}+',name:'+${item.id}"></p>
    </li>
</ul>
</body>
</html>